# !/usr/bin/env python
#  -*- coding: utf-8 -*-
"""
@Author        : JackYang
@Time          : 2024/2/19 02:35
@FileName      : 最长子序列.py
@Editors       : PyCharm
"""

nums = [1, 5, 2, 4, 3, 8, 9, 6, 7]

dp = [0] * len(nums)
dp[0] = 1
for i in range(len(nums)):
    n = nums[i]
    for j in range(i + 1, len(nums)):
        if n <= nums[j]:
            if dp[i] >= dp[j]:
                dp[j] = dp[i] + 1
                print(dp)
print(max(dp))
